package com.fitow.common.config;

/**
 * @author: hxy
 * @date: 2017/10/24 10:16
 */
public enum EnumUtil {

    //*****************************************************成功******************************************
    OK_200("200","请求成功" , "Success!!!"),

    //**********************************************系统异常**********************************************
    E_500("500", "请求失败" , "Failure!!!"),
    E_501("501", "未获取到用户信息" , "userInfo is lost!!!"),

    //**********************************************自定义统一业务异常（不能为空 和 找不到）**********************************************
    E_10001("10001", "id不能为空" , "id is empty!!!"),
    E_10002("10002", "name不存在" , "name is empty!!!"),
    E_10003("10003", "locateId或 localeId不能为空" , "locateId or localeId or gzddId is empty!!!"),
    E_10004("10004", "type不能为空" , "type is empty!!!"),
    E_10005("10005", "code不能为空" , "code is empty!!!"),
    E_10006("10006", "value不能为空" , "value is empty!!!"),
    E_10007("10007", "开始日期不能为空" , "start time is empty!!!"),
    E_10008("10008", "结束日期不能为空" , "end time is empty!!!"),
    E_10009("10009", "partNumber不能为空" , "partNumber is empty!!!"),
    E_10010("10010", "warnStock不能为空" , "warnStock is empty!!!"),
    E_10011("10011", "不合格项id列表不能为空" , "item id is empty!!!"),
    E_10012("10012", "任务指导书不能为空" , "guideline is empty!!!"),
    E_10013("10013", "任务指导书id不能为空" , "guideline id is empty!!!"),
    E_10014("10014", "任务指导书no不能为空" , "guideline no is empty!!!"),
    E_10015("10015", "找不到对应工作地点" , "The work place is not exist!!!"),
    E_10016("10016", "找不到对应作业内容" , "The work content is not exist!!!"),
    E_10017("10017", "找不到对应工单" , "The work order is not exist!!!"),
    E_10018("10018", "找不到对应委托书" , "The proxy is not exist!!!"),
    E_10019("10019", "找不到对应作业指导书" , "The work guideline is not exist!!!"),
    E_10020("10020", "找不到对应任务" , "The work task is not exist!!!"),
    E_10021("10021", "找不到对应异常信息" , "The exception is not exist!!!"),
    E_10022("10022", "找不到对应零件" , "The part is not exist!!!"),
    E_10023("10023", "task id不能为空" , "task id is empty!!!"),
    E_10024("10024", "work type id不能为空" , "work type id is empty!!!"),
    E_10025("10025", "生产线名称不能为空" , "product-line name is empty!!!"),
    E_10026("10026", "班次不能为空" , "class name is empty!!!"),
    E_10027("10027", "sqwmDataId不能为空" , "sqwmDataId is empty!!!"),
    E_10028("10028", "找不到对应的不合格项" , "The item is not exist!!!"),
    E_10029("10029", "零件id不能为空" , "part id is empty!!!"),
    E_10030("10030", "委托书id不能为空" , "proxy id is empty!!!"),
    E_10031("10031", "找不到对应的SQWM或SAP信息" , "SQWM or SAP is not exist!!!"),
    E_10032("10032", "工单id不能为空" , "Order id is empty!!!"),
    E_10033("10033", "找不到该id对应的班次" , "Can not find this class !!!"),
    E_10034("10034", "作业类型只能是1或2" , "only 1 or 2 !!!"),
    E_10035("10035", "作业内容id不能为空" , "contentId id is empty !!!"),
    E_10036("10036", "任务委托书和指导书不在同一工作地点下" , "contentId id is empty !!!"),
    E_10037("10037", "找不到“检具检验”作业内容" , " Jianjujianyan is not exist !!!"),

    E_10099("10099", "参数不完整" , "params are not completed!!!"),
    E_10100("10100", "id必须为空" , "Id must be empty!!!"),
    E_10101("10101", "参数不正确" , "Params are not right!!!"),

    //**********************************************工作台**********************************************
    E_20001("20001", "工作台编号重复" , "bench no is multiple!!!"),
    E_20002("20002", "该工作台信息已存在" , "bench`name exist!!!"),
    E_20003("20003", "工作台名称已存在，请重新添加工作台名称" , "bench`name is multiple!!!"),
    E_20004("20004", "启用状态不能为空" , "status is empty!!!"),
    E_20005("20005", "找不到该工作台" , "The bench is not exist!!!"),
    E_20006("20006", "该工作台正在使用中，不允许修改" , "The bench is being used, operation is not allowed!!!"),
    E_20010("20010", "权限不足" , "Permission denied!!!"),

    //**********************************************工作台**********************************************
    E_30001("30001", "未找到对应的供应商统计信息" , "The supplier info is not exist!!!"),

    //**********************************************文件上传下载 xw.s **********************************************
    E_40001("40001", "请上传类似*.*标准格式的文件" , "only pattern as *.* is allowed!!!"),
    E_40002("40002", "不允许上传该后缀文件" , "The suffix is not allowed!!!"),
    E_40003("40003", "超过文件最大上限" , "over the max size!!!"),
    E_40004("40004", "上传失败" , "upload failed!!!"),

    //**********************************************工单**********************************************
    E_50001("50001", "该工单下有百检任务，请先删除对应的百检任务" , "Please del the baijian task realted Before deleting the order!!!"),
    E_50002("50002", "该工单已结束，不能修改" , "This order has been ended, editing is not allowed!!!"),
    E_50003("50003", "该工单还没到计划检验日期" , "The plan_exam_date is after today!!!"),
    E_50004("50004", "请先结束此工单对应的任务，然后再关闭工单！" , "There are tasks not finished!!!"),
    E_50005("50005", "数据出错，工单的零件分配数量超过工单零件总数量" , "number of assigned is over the total count!!!"),
    E_50006("50006", "请先结束此工单对应的任务，然后再关闭工单" , "There are tasks related going!!!"),
    E_50007("50007", "该工单下已完成数量不等于总数量，请在备注栏填写原因" , "The completed count != total count, please fulfill the remark!!!"),
    E_50008("50008", "当前工单下有未开始的任务，请先删除未开始任务" , "Delete the tasks not started First!!!"),
    E_50009("50009", "新的总数 < 已经分配和异常的数据总量" , "total count is too small!!!"),
    E_50010("50010", "同一地点，统一零件号，同一批次号不允许重复" , "Data is exist!!!"),

    //**********************************************任务**********************************************
    E_60001("60001", "数量不足，请重新分配" , "The left is not enough, Please assign again!!!"),
    E_60002("60002", "任务已经开始，不允许操作" , "The task is going, not allowed!!!"),
    E_60003("60003", "当前有进行中的任务" , "There are tasks going!!!"),
    E_60004("60004", "当前任务与工作台不匹配" , "The task do not match the bench!!!"),
    E_60005("60005", "请完善跟线任务的任务委托书" , "fulfill The proxy!!!"),
    E_60006("60006", "请完善跟线任务的作业指导书" , "fulfill The guideline!!!"),
    E_60007("60007", "不合格图片数量不足" , "fulfill The proxy!!!"),
    E_60008("60008", "请先扫描箱码信息" , "Please scan the box code information first"),
    E_60009("60009", "数量不能大于工单整箱数量" , "The quantity is over the single box`s!!!"),
    E_60010("60010", "无标签信息", "No label information"),
    E_60011("60011", "请先给上一箱零件打印标签并粘贴", "Please print and paste the label for the last box of parts first"),
    E_60012("60012", "一个任务的一个检测内容下人员班组长不能重复", "Same task and same content has same work user!!!"),
    E_60013("60013", "合格数量不等于打印的合格标签中数量之和", "The qualified quantity is not equal to the sum of the quantity in the printed qualified label"),
    E_60014("60014", "请完善不合格项", "Please complete the unqualified items"),
    E_60015("60015", "此箱码编号已绑定", "This box code number is bound"),
    E_60016("60016", "不能自定义打印标签", "You cannot customize print labels"),
    E_60017("60017", "任务数据异常，找不到待检验数", "Task data is error!!!"),
    E_60018("60018", "数量有误", "Wrong quantity"),
    E_60019("60019", "漏检数量不能超过任务零件数", "miss part-count is over task part-count"),
    E_60020("60020", "条形码识别失败", "Barcode recognition failed"),
    E_60021("60021", "作业内容不能为空", "task content is empty!!!"),
    E_60022("60022", "完成数量不能超过任务分配总数量", "The completed quantity cannot exceed the total quantity assigned to the task"),
    E_60023("60023", "检验数量不能大于任务总数", "The inspection quantity cannot be greater than the total number of tasks"),
    E_60024("60024", "自定义打印合格标签时，数量需小于整箱数量", "When custom printing qualified labels, the quantity must be less than the full box quantity"),
    E_60025("60025", "仅可同时进行两个跟线任务" , "Only two line following tasks can be performed at the same time"),
    E_60026("60026", "请打印合格标签" , "Please print the qualified label"),
    E_60027("60027", "请在箱码管理中打印自定义的合格标签" , "Please print custom qualified labels in container code management"),
    E_60028("60028", "请在箱码管理中打印自定义的不合格标签" , "Please print customized unqualified labels in container code management"),
    E_60029("60029", "该任务已审核通过" , "The task has been approved"),
    E_60030("60030", "箱码已废弃" , "The box code has been discarded"),
    E_60031("60031", "该工作台正在使用中" , "The workbench is in use"),
    E_60032("60032", "请打印合格标签并粘贴" , "Please print and paste the qualified label"),
    E_60033("60033", "该任务已提交完成" , "The task has been submitted"),
    E_60034("60034", "该任务不能重复审核" , "This task cannot be approved repeatedly"),
    //**********************************************异常**********************************************
    E_70001("70001", "异常零件数量不能大于工单中剩余零件数量" , "exceptCount is too many!!!"),
    E_70002("70002", "异常零件数不能大于工单中零件总数量-已完成数量" , "exceptCount is over the totalCount-completeCount of the order!!!"),
    E_70003("70003", "同一工单编号、同一记录状态仅可有一条记录信息" , "Over one exception have the same orderNo and status!!!"),
    E_70004("70004", "工单尚未开始，不能创建检验中异常" , "Order is not started!!!"),
    E_70005("70005", "工单已完成，不能操作异常" , "Order has finished!!!"),

    //**********************************************生产线**********************************************
    E_80001("80001", "此生产线已存在" , "product-line name is existed!!!"),

    //**********************************************泛微**********************************************
    E_90001("90001", "远程调用出错，请重试！" , "fanwei service was invalid,please try again!!!"),
    E_90002("90002", "远程调用数据出错，请重试！" , "fanwei service was invalid,please try again!!!"),
    E_90003("90003", "未找到该标识，请联系管理员！" , "Context is invalid, Please contact administrator!!!"),

    //**********************************************班次**********************************************
    E_11001("11001", "该地点下班次已经超过三个" , "the quality of class under this area is over 3 !!!"),

    //**********************************************作业指导书**********************************************
    E_12001("12001", "该作业指导书已存在" , "The guideline is exist !!!"),


    ;



    //******************************************************************************************************************

    private String code;
    private String name;
    private String name_en;
    EnumUtil() {}

    EnumUtil(String code, String name, String nameEn) {
        this.code = code;
        this.name = name;
        this.name_en = nameEn;
    }

    public String getCode() {
        return code;
    }
    public void setCode(String code) {
        this.code = code;
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public String getName_en() {
        return name_en;
    }
    public void setName_en(String name_en) {
        this.name_en = name_en;
    }

    //根据code返回提示语
    public static Object getName(String code) {
        for(EnumUtil data : EnumUtil.values()) {
            if(data.getCode().equals(code)) {
                return data.getName();
            }
        }
        return null;
    }
}
